﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Configuration;

namespace PSE.Updater.Common.Configurations.Client
{
    /// <summary>
    /// Entidade que representa as configurações do Updater
    /// </summary>
    public class UpdateConfigurationSection : ConfigurationSection
    {
        /// <summary>
        /// Servidor de Atualização contendo os arquivos para atualização
        /// </summary>
        [ConfigurationProperty("defaultUpdateServerUrl", IsKey = false, IsRequired = true)]
        public string DefaultUpdateServerUrl
        {
            get { return (string)this["defaultUpdateServerUrl"]; }
            set { this["defaultUpdateServerUrl"] = value; }
        }
        ///// <summary>
        ///// Nome do Sistema
        ///// </summary>
        //[ConfigurationProperty("systemName", IsKey = false, IsRequired = true)]
        //public string SystemName
        //{
        //    get { return (string)this["systemName"]; }
        //    set { this["systemName"] = value; }
        //}
        ///// <summary>
        ///// Versão do Sistema
        ///// </summary>
        //[ConfigurationProperty("systemVersion", IsKey = false, IsRequired = true)]
        //public string SystemVersion
        //{
        //    get { return (string)this["systemVersion"]; }
        //    set { this["systemVersion"] = value; }
        //}
        /// <summary>
        /// Caminho do Executável do Sistema
        /// </summary>
        //[ConfigurationProperty("systemExe", IsKey = false, IsRequired = true)]
        //public string SystemExe
        //{
        //    get { return (string)this["systemExe"]; }
        //    set { this["systemExe"] = value; }
        //}
        /// <summary>
        /// Lista de dependências do Sistema
        /// </summary>
        //[ConfigurationProperty("systemDependencies", IsDefaultCollection = true)]
        //public UpdateConfigurationElementCollection SystemDependencies
        //{
        //    get { return (UpdateConfigurationElementCollection)base["systemDependencies"]; }
        //}

        /// <summary>
        /// Lista de servidores
        /// </summary>
        [ConfigurationProperty("updateServers", IsDefaultCollection = true)]
        public UpdateServersConfigurationElementCollection UpdateServers
        {
            get { return (UpdateServersConfigurationElementCollection)base["updateServers"]; }
        }
    }
}
